<?php
/**
 * Created by JetBrains PhpStorm.
 * User: thanh
 * Date: 4/14/12
 * Time: 9:12 PM
 * To change this template use File | Settings | File Templates.
 */
class FacilityList extends CPortlet
{
    public function init()
    {
        //$this->title=CHtml::encode(Yii::app()->user->name);
        parent::init();
    }

    protected function renderContent()
    {
        $facilityCritria = new CDbCriteria(
            array(
                'condition' => 'status=1',
                'order' => 'create_time DESC',
            )
        );
        $dataFacilities = new CActiveDataProvider('Facility', array(
            'pagination' => array(
                'pageSize' => Yii::app()->params['postsPerPage'],
            ),
            'criteria' => $facilityCritria,));
        $this->render('facility',array('dataProvider'=>$dataFacilities));
    }

}
